<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
	<ui:composition template="/template.xhtml">
		<ui:define name="content">
			<h:form id="formTk">
				<p:panel styleClass="layout_2_L" id="pn_left">
					<h:panelGrid columns="1">
						<p:inputText id="tenGiaoVien" rendered="#{loginBean.quanLy}" value="#{thongKeBean.ettThongKe.tenGiaoVien}"/>
						<p:watermark for="tenGiaoVien" value="Tên giáo viên" />
						<p:inputText id="tenMonHoc" value="#{thongKeBean.ettThongKe.tenMonHoc}"/>
						<p:watermark for="tenMonHoc" value="Tên môn học" />
						<p:calendar value="#{thongKeBean.ettThongKe.fromDate}"
									id="fromDate"/>
						<p:watermark for="fromDate" value="Từ ngày" />
						<p:calendar value="#{thongKeBean.ettThongKe.toDate}"
									id="toDate"/>
						<p:watermark for="toDate" value="Đến ngày" />									
						<p:selectOneMenu id="cbxPhongMay"
							value="#{thongKeBean.ettThongKe.phongMay}" style="width:156px">
							<f:selectItem itemLabel="--Phòng máy--" itemValue="-1"/>
							<f:selectItems value="#{thongKeBean.phongMayList}" var="phongMay"
								itemLabel="#{phongMay.tenPhongMay}" itemValue="#{phongMay.id}" />
						</p:selectOneMenu>
						<p:selectOneMenu id="cbxTietHoc"
							value="#{thongKeBean.ettThongKe.tietHoc}" style="width:156px">
							<f:selectItem itemLabel="--Tiết học--" itemValue="-1" />
							<f:selectItems value="#{thongKeBean.tietHocList}" var="tietHoc"
								itemLabel="#{tietHoc.moTa}" itemValue="#{tietHoc.idTietHoc}" />
						</p:selectOneMenu>
						<p:selectOneMenu id="cbxTrangThai" value="#{thongKeBean.ettThongKe.status}" style="width:156px">
							<f:selectItem itemLabel="--Trạng thái--" itemValue="-10" />  
				            <f:selectItem itemLabel="Đã phê duyệt" itemValue="1" />  
				            <f:selectItem itemLabel="Đã hủy" itemValue="-1" />
				            <f:selectItem itemLabel="Chưa phê duyệt" itemValue="0" />
						</p:selectOneMenu>
						<p:commandButton value="Thống kê" icon="ui-icon-note" actionListener="#{thongKeBean.thongKe}" update=":formTk:tblLichDk"/>
					</h:panelGrid>
				</p:panel>
				<p:panel styleClass="layout_2_R" id="pn_right">
				<p:commandButton actionListener="#{thongKeBean.export}"
						value="Xuất báo cáo" ajax="false" icon="ui-icon-print"/>
					<p:dataTable id="tblLichDk" var="lichDk"
						value="#{thongKeBean.lichDangKyList}" rowIndexVar="rowIndex"
						paginator="true" rows="15"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="10,15,20" paginatorPosition="bottom">
						<p:column headerText="STT" styleClass="textCenter">
							<h:outputText value="#{rowIndex+1}" />
						</p:column>
						<p:column headerText="Phòng" styleClass="textCenter">
							<h:outputText value="#{lichDk.tenPhongMay}" />
						</p:column>
						<p:column headerText="Tiết" styleClass="textCenter">
							<h:outputText value="#{lichDk.moTaTietHoc}" />
						</p:column>
						<p:column headerText="Ngày" styleClass="textCenter">
							<h:outputText value="#{lichDk.ngayDat}">
								<f:convertDateTime pattern="dd/MM/yyyy" />
							</h:outputText>
						</p:column>
						<p:column headerText="Giáo viên" rendered="#{loginBean.quanLy}">
							<h:outputText value="#{lichDk.tenGiaoVien}" />
						</p:column>
						<p:column headerText="Tiêu đề">
							<h:outputText value="#{lichDk.tieuDe}" />
						</p:column>
						<p:column headerText="Trạng thái" styleClass="textCenter">
							<h:outputText
								value="#{lichDangKyBean.convertStatus(lichDk.status)}" />
						</p:column>
					</p:dataTable>
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>